Trees | Indices | Toggle frames |
---|
Key constants and utilities for pyglet.window.
Usage:
from pyglet.window import Window from pyglet.window import key window = Window() @window.event def on_key_press(symbol, modifiers): # Symbolic names: if symbol == key.RETURN: # Alphabet keys: elif symbol == key.Z: # Number keys: elif symbol == key._1: # Number keypad keys: elif symbol == key.NUM_1: # Modifiers: if modifiers & key.MOD_CTRL:
KeyStateHandler
Simple handler that tracks the state of keys on the keyboard.
|
str |
modifiers_string(modifiers)
Return a string describing a set of modifiers.
|
str |
symbol_string(symbol)
Return a string describing a key symbol.
|
str |
motion_string(motion)
Return a string describing a text motion.
|
user_key(scancode)
Return a key symbol for a key not supported by pyglet.
|
__package__ =
|
Return a string describing a set of modifiers.
Example:
>>> modifiers_string(MOD_SHIFT | MOD_CTRL) 'MOD_SHIFT|MOD_CTRL'
Return a string describing a key symbol.
Example:
>>> symbol_string(BACKSPACE) 'BACKSPACE'
Return a string describing a text motion.
Example:
>>> motion_string(MOTION_NEXT_WORD): 'MOTION_NEXT_WORD'
Return a key symbol for a key not supported by pyglet.
This can be used to map virtual keys or scancodes from unsupported keyboard layouts into a machine-specific symbol. The symbol will be meaningless on any other machine, or under a different keyboard layout.
Applications should use user-keys only when user explicitly binds them (for example, mapping keys to actions in a game options screen).
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:18 2009 | http://epydoc.sourceforge.net |